<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="cn._2dland.access.jdo.*"%>
<%
	Long userID = (Long)session.getAttribute("LoginUserID");
	if(userID == null) response.sendRedirect("/console/login.jsp");

	List<Video> videos = VideoManager.getUserVideos(userID);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>视频列表</title>
	<link rel="stylesheet" type="text/css" href="/style/style.css">
	<script type="text/javascript" src="/js/console.js"></script>
</head>
<body>
	<div>
		<input type="button" value="添加视频" onclick="open('add_video.jsp', '_blank', 'height=100,width=440')">
	</div>
	<div style="margin: 10px;">
		<table id="video_list" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<th width="24">
					<input type="checkbox" id="video_all" name="video_all" onclick="check_all(this.checked);">
				</th>
				<th width="40">编号</th>
				<th width="230">视频标题</th>
				<th>视频实际地址</th>
			</tr>
<%
	for(int i=0; videos!=null && i<videos.size(); i++){
		Video v = videos.get(i);
%>
			<tr>
				<td><input type="checkbox" value="<%=v.getVideoID()%>" name="video_item" onclick="check_one();"></td>
				<td><%=v.getVideoID()%></td>
				<td><a href="https://project2dl.appspot.com/link?vid=<%=v.getVideoID()%>" target="_blank"><%=v.getVideoTitle()%></a></td>
				<td><a href="<%=v.getVideoURL()%>" target="_blank"><%=v.getVideoURL()%></td>
			</tr>
<%
	}
%>
		</table>
	</div>
</body>
</html>